import { createRequestPromise } from '../utils/request';

export function getRoleData (params) {
  return createRequestPromise('ROLE_LIST_URL', {
    page: params.page,
    pageSize: params.size,
  })
  .then((res) => {
    return {
      ...res,
      rows: res.rows.map((row, idx) => {
        return {
          ...row,
          index: (params.page - 1) * params.size + idx + 1,
        };
      }),
    };
  });
}
